package com.hutianao.gqgl.information.internationalOffer.service.impl;

import com.hutianao.gqgl.information.internationalOffer.entity.SearchInternationalOfferEntity;
import com.hutianao.gqgl.information.internationalOffer.service.InternationalOfferService;
import com.hutianao.gqgl.mybatis.entity.InternationalOfferEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PaddingEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PadingRstType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class InternationalOfferServiceImpl implements InternationalOfferService {
    @Resource
    private com.hutianao.gqgl.information.internationalOffer.respository.InternationalOfferDao InternationalOfferDao;

    @Override
    public PadingRstType<InternationalOfferEntity> queryInternationalOfferInfoListByPage(SearchInternationalOfferEntity search, PaddingEntity padding) {
        padding.deal(InternationalOfferEntity.class);
        PadingRstType<InternationalOfferEntity> padingRstType = new PadingRstType<>();
        padingRstType.setPage(padding.getPage());
        List<InternationalOfferEntity> list = InternationalOfferDao.queryInternationalOfferInfoListByPage(search,padding);
        padingRstType.setRawRecords(list);
        Integer total = InternationalOfferDao.queryInternationalOfferInfoTotal(search);
        padingRstType.setTotal(total);
        padingRstType.putItems();

        return padingRstType;
    }
}
